package com.AC.ACDIDI;

import org.junit.Test;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 *
 */
public class test1 {

    public int getNum(int n){
        int res = 0;
        for(int i = 0; i<=9; i++){
            for(int j = 0; j<=9; j++){
                if(j == i) continue;
                for(int k = 0; k<=9; k++){
                    if(k == j) continue;
                    if(i * 100 + j * 10 + k + i * 100 + k * 10 + k == n ){
                        res ++;
                        System.out.println(i + " " + j + " " + k);
                    }
                }
            }
        }
        return res;
    }

        public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            int n = sc.nextInt();
            sc.close();
            int res = 0;
            List<int[] > list = new ArrayList<>();
            for(int i = 1; i<=9; i++){
                for(int j = 0; j<=9; j++){
                    if(j == i) continue;
                    for(int k = 0; k<=9; k++){
                        if(k == j) continue;
                        if(i * 100 + j * 10 + k + i * 100 + k * 10 + k == n ){
                            res ++;
                        }
                    }
                }
            }
            System.out.println(res);
            for(int[] arr : list){
                System.out.println(arr[0] + " " + arr[1]);
            }

        }

    @Test
    public void test(){
        System.out.println(getNum(1068));
    }



}
